<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>斐波那契数计算</title>
    <style>
        /* 通用样式 */
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f7fc;
            color: #333;
        }
        .container {
            max-width: 800px;
            margin: 40px auto;
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            color: #4CAF50;
        }

        /* 表单样式 */
        form {
            text-align: center;
            margin-bottom: 30px;
        }

        button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            font-size: 16px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        button:hover {
            background-color: #45a049;
        }

        /* 结果展示样式 */
        .error {
            color: red;
            font-weight: bold;
            text-align: center;
            margin-bottom: 20px;
        }

        .result {
            font-size: 18px;
            text-align: center;
            background-color: #f1f8e9;
            padding: 15px;
            border-radius: 4px;
            border: 1px solid #d3e0d6;
        }

        .result div {
            margin: 10px 0;
        }

        .result .success {
            color: #2e7d32;
        }

        .result .error {
            color: #c62828;
        }

    </style>
</head>
<body>
    <div class="container">
        <h1>计算第92个斐波那契数</h1>
        <form action="{% url 'check_recursive_1min' %}" method="post">
            {% csrf_token %}
            <button type="submit">开始计算</button>
            <br>
            <br>
            <button><a href="{% url 'experiment1' %}" style="text-decoration: none; color: white">返回上一页</a></button>
        </form>

        {% if result %}
            <h2>计算结果：</h2>

            {% if result.error_message %}
                <div class="error">{{ result.error_message }}</div>
                <div class="result">
                    <div class="success">记忆化递归计算成功：</div>
                    <div>结果为：{{ result.fibonacci_number }}</div>
                    <div>用时：{{ result.memo_time }}秒</div>
                </div>
            {% endif %}
        {% endif %}
    </div>
</body>
</html>
